package com.canlihao.ui.mvp.model;

import android.util.Log;

/*******
 *
 *Created by panda李
 *
 *创建时间 2020/3/30
 *
 *类描述：
 *
 ********/
public class DataModel {
    private static final String TAG = "DataModel";
    public static BaseModel request(String token) {
        // 声明一个空的BaseModel
        BaseModel model = null;
        try {
            //利用反射机制获得对应Model对象的引用
            model = (BaseModel) Class.forName(token).newInstance();
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
            e.printStackTrace();
            Log.e(TAG, "Model反射错误");
        }
        return model;
    }
}
